<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<beans> 
	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<value>classpath:jdbc.properties</value>
			</list>
		</property>
	</bean>

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="testOnBorrow" value="true" />
		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
		<property name="driverClassName" value="${r"${db.source.driver}"}" />
		<property name="url" value="${r"${db.source.url}"}" />
		<property name="username" value="${r"${db.source.username}"}" />
		<property name="password" value="${r"${db.source.password}"}" />
		<property name="minIdle" value="${r"${db.source.min.idle}"}" />
       	<property name="maxActive" value="${r"${db.source.max.active}"}" />
      	<property name="maxIdle" value="${r"${db.source.max.idle}"}" />
		<property name="initialSize" value="30" />
		<property name="defaultAutoCommit" value="true" />
	</bean>
	
	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource" />
	</bean>
	
	<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
		<property name="transactionManager" ref="transactionManager" />
	</bean>
    
	<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
		<property name="configLocation"  value="classpath:${daoConf}"/>
		<property name="dataSource" ref="dataSource"/>
	</bean>
	
	<bean id="sqlMapClientOperations" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
		<property name="sqlMapClient" ref="sqlMapClient" />
	</bean>
	<bean id="<@lowerFirstChar>${className}</@lowerFirstChar>Dao" class="${daoImpl}">
		<property name="sqlMapClientOperations" ref="sqlMapClientOperations" />
	</bean>
</beans>
